home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / PInterfaces / OCETemplates.p < prev    next >
Encoding:
Text File  |  1995-04-18  |  57.6 KB  |  1,722 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        OCETemplates.p
  3.  
  4.      Contains:    Apple Open Collaboration Environment Templates Interfaces.
  5.  
  6.      Version:    Technology:    AOCE Toolbox 1.02
  7.                  Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT OCETemplates;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __OCETEMPLATES__}
  30. {$SETC __OCETEMPLATES__ := 1}
  31.  
  32. {$I+}
  33. {$SETC OCETemplatesIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __EVENTS__}
  43. {$I Events.p}
  44. {$ENDC}
  45. {    Quickdraw.p                                                    }
  46. {        MixedMode.p                                                }
  47. {        QuickdrawText.p                                            }
  48. {    OSUtils.p                                                    }
  49. {        Memory.p                                                }
  50.  
  51. {$IFC UNDEFINED __CONTROLS__}
  52. {$I Controls.p}
  53. {$ENDC}
  54. {    Menus.p                                                        }
  55.  
  56. {$IFC UNDEFINED __APPLEEVENTS__}
  57. {$I AppleEvents.p}
  58. {$ENDC}
  59. {    Errors.p                                                    }
  60. {    EPPC.p                                                        }
  61. {        AppleTalk.p                                                }
  62. {        Files.p                                                    }
  63. {        PPCToolbox.p                                            }
  64. {        Processes.p                                                }
  65. {    Notification.p                                                }
  66.  
  67. {$IFC UNDEFINED __DIALOGS__}
  68. {$I Dialogs.p}
  69. {$ENDC}
  70. {    Windows.p                                                    }
  71. {    TextEdit.p                                                    }
  72.  
  73. {$IFC UNDEFINED __OCE__}
  74. {$I OCE.p}
  75. {$ENDC}
  76. {    Aliases.p                                                    }
  77. {    Script.p                                                    }
  78. {        IntlResources.p                                            }
  79.  
  80. {$IFC UNDEFINED __OCESTANDARDMAIL__}
  81. {$I OCEStandardMail.p}
  82. {$ENDC}
  83. {    OCEAuthDir.p                                                }
  84. {    OCEMail.p                                                    }
  85. {        DigitalSignature.p                                        }
  86. {        OCEMessaging.p                                            }
  87.  
  88. {$PUSH}
  89. {$ALIGN MAC68K}
  90. {$LibExport+}
  91.  
  92. CONST
  93.     kDETAspectVersion            = -976;
  94.     kDETInfoPageVersion            = -976;
  95.     kDETKillerVersion            = -976;
  96.     kDETForwarderVersion        = -976;
  97.     kDETFileTypeVersion            = -976;
  98.  
  99. {    "Normal" separation for template IDs within the file (this is just a suggestion; you can use whatever
  100.     separation you like, so long as two separate templates don't have overlapping resources): }
  101.     kDETIDSep                    = 250;
  102.  
  103. { A few predefined base IDs (again, just suggestions): }
  104.     kDETFirstID                    = 1000;
  105.     kDETSecondID                = 1000 + kDETIDSep;
  106.     kDETThirdID                    = 1000 + 2 * kDETIDSep;
  107.     kDETFourthID                = 1000 + 3 * kDETIDSep;
  108.     kDETFifthID                    = 1000 + 4 * kDETIDSep;
  109.  
  110. {    Templates consist of a set of associated resources, at constant offsets from a "base ID" set by the
  111.     signature resource of the template. In the case of aspect templates, most of the resources in the
  112.     template are accessible from the template as property default values. The property number is the same
  113.     as the offset from the base ID of the resource. In describing the resources which make up templates,
  114.     we give the type, the offset, and a description. For aspect templates, the offset is also the property #. 
  115.     
  116.     All templates include the following resource fork resources:
  117.  
  118.      Type    Offset                        Description
  119.      ----    ------                        -----------
  120.     'rstr'    kDETTemplateName            Contains the name of the template
  121.  
  122. }
  123.     kDETTemplateName            = 0;
  124.  
  125. {    Aspects, info-pages, and forwarders include the following as well:
  126.  
  127.      Type    Offset                        Description
  128.      ----    ------                        -----------
  129.     'rstr'    kDETRecordType                Contains the type of record this applies to
  130.     'rstr'    kDETAttributeType            Contains the type of attribute this applies to
  131.     'detn'    kDETAttributeValueTag        Contains the tag of the attribute values this applies to
  132.  
  133. }
  134.     kDETRecordType                = 1;
  135.     kDETAttributeType            = 2;
  136.     kDETAttributeValueTag        = 3;
  137.  
  138. { ************************************ Aspects }
  139. {    In the case of aspects, property numbers and resource id offsets are the same. Therefore, some of the following
  140.     defines are used for resource offsets, some are used for dynamically generated properties, and some are used for
  141.     both (i.e., properties which may be dynamically generated, but if they aren't, then they're taken from the
  142.     resource). Resource types are given in all cases below; even if there is no actual resource (for example in
  143.     the case of kDETAspectName), it indicates the type for the dynamically generated property. A resource type of
  144.     'rstr' corresponds to a property type of kDETPrTypeString; type 'detn' corresponds to kDETPrTypeNumber; and
  145.     'detb' corresponds to kDETPrTypeBinary.
  146.  
  147.      Type    Offset                        Description
  148.      ----    ------                        -----------
  149.     'deta'    0                            Identifies the type of resource
  150.     'detc'    kDETCode                    Is the code resource, if any is used
  151.     'ICN#'    kDETAspectMainBitmap
  152.     'icl8'    kDETAspectMainBitmap
  153.     'icl4'    kDETAspectMainBitmap
  154.     'ics#'    kDETAspectMainBitmap
  155.     'ics8'    kDETAspectMainBitmap
  156.     'ics4'    kDETAspectMainBitmap
  157.     'sicn'    kDETAspectMainBitmap        Is the icon suite to display for this item type (main aspect only)
  158.     'rstr'    kDETAspectName                Contains the name of the item (attribute main aspect only)
  159.     'rst#'    kDETAspectCategory            Contains the internal categories for the record type (main aspect only)
  160.     'rst#'    kDETAspectExternalCategory    Contains the external (user-visible) names which correspond to the categories in
  161.                                         kDETAspectCategory; if this resource is not present, external names are taken from
  162.                                         another template; if no other template provides an external name for a given internal
  163.                                         category, the internal name is used as the external name (main aspect only)
  164.     'rstr'    kDETAspectKind                Is the item kind to display (main aspect only)
  165.     'detn'    kDETAspectGender            Is the gender of this kind of object for internationalization (main aspect only)
  166.     'rstr'    kDETAspectWhatIs            Is the string for balloon help when item is in sublist (main aspect only)
  167.     'rstr'    kDETAspectAliasKind            Is the item kind to display for aliases to this type of item (main aspect only)
  168.     'detn'    kDETAspectAliasGender        Is the gender of an alias to this kind of object for internationalization (main aspect only)
  169.     'rstr'    kDETAspectAliasWhatIs        Is the string for balloon help when an alias to the item is in sublist (main aspect only)
  170.     'rst#'    kDETAspectBalloons            Is a list of strings for balloon help; for each item in an info-page, it's
  171.                                         property # times 2 is used as an index into this array; if the item is not editable,
  172.                                         then the property # times 2 plus 1 is used
  173.     'rstr'    kDETAspectNewMenuName        Is the string to be used for the user to select new item creation; for records, the
  174.                                         string is used as a menu entry in the Catalogs menu; for attributes, the string
  175.                                         is used in a selection dialog invoked by an "Add..." button
  176.     'rstr'    kDETAspectNewEntryName        Is the name to be used for new records (with a digit appended if not unique)
  177.     'detb'    kDETAspectNewValue            Is the value to use when creating a new attribute value; the first four bytes
  178.                                         is the tag; the rest is the attribute value contents
  179.     'detn'    kDETAspectSublistOpenOnNew    If true (non-zero), automatically open newly created entries (property can be set
  180.                                         from a code resource, or via a default value in a resource)
  181.     'dett'    kDETAspectLookup            Is the attribute-to-property translation table
  182.     'rstr'    kDETAspectDragInString        Is a string describing the action of dragging into this aspect (if any)
  183.     'rstr'    kDETAspectDragInVerb        Is a single, short word that's the verb of the action (like "add" or "drop"; if
  184.                                         there's any doubt, use "OK")
  185.     'rstr'    kDETAspectDragInSummary        Is a short phrase that describes the action, suitable to be included in a selection list
  186.     'rst#'    kDETAspectRecordDragIn        Is a list of type pairs; in each pair, the first is the type of a record which
  187.                                         can be dragged into this aspect, and the second is the attribute type to store
  188.                                         the reference in
  189.     'rst#'    kDETAspectRecordCatDragIn    Is a list of category/attribute type pairs; in each pair, the first is the
  190.                                         category of records which can be dragged in, and the second is the type of
  191.                                         attribute to place the alias in
  192.     'rst#'    kDETAspectAttrDragIn        Is a list of type triples; in each triple, the first is the record type which can be
  193.                                         dragged from (or "" for any), the second is the attribute type which can be dragged
  194.                                         in, and the third is the attribute type to store the new attribute in
  195.     'rst#'    kDETAspectDragOut            Is a list of attribute types which can be dragged out of this aspect (an 'rst#'
  196.                                         resource with no entries means nothing can be dragged out; no 'rst#' resource means
  197.                                         everything can be dragged out)
  198.     'detm'    kDETAspectViewMenu            Is a table to fill in the view menu from
  199.     'detp'    kDETAspectReverseSort        Is a table listing which properties to sort in reverse order
  200.     'detw'    kDETAspectInfoPageCustomWindow    Is a specification of a custom window size/placement & whether to use the
  201.                                             page-selector (main aspect only)
  202.     'detv'    kDETAspectInfoPageCustomWindow    Is a view list which is common to all info-pages (main aspect only)
  203. }
  204.     kDETAspectCode                = 4;
  205.     kDETAspectMainBitmap        = 5;
  206.     kDETAspectName                = 6;
  207.     kDETAspectCategory            = 7;
  208.     kDETAspectExternalCategory    = 8;
  209.     kDETAspectKind                = 9;
  210.     kDETAspectGender            = 10;
  211.     kDETAspectWhatIs            = 11;
  212.     kDETAspectAliasKind            = 12;
  213.     kDETAspectAliasGender        = 13;
  214.     kDETAspectAliasWhatIs        = 14;
  215.     kDETAspectBalloons            = 15;
  216.     kDETAspectNewMenuName        = 16;
  217.     kDETAspectNewEntryName        = 17;
  218.     kDETAspectNewValue            = 18;
  219.     kDETAspectSublistOpenOnNew    = 19;
  220.     kDETAspectLookup            = 20;
  221.     kDETAspectDragInString        = 21;
  222.     kDETAspectDragInVerb        = 22;
  223.     kDETAspectDragInSummary        = 23;
  224.     kDETAspectRecordDragIn        = 24;
  225.     kDETAspectRecordCatDragIn    = 25;
  226.     kDETAspectAttrDragIn        = 26;
  227.     kDETAspectAttrDragOut        = 27;
  228.     kDETAspectViewMenu            = 28;
  229.     kDETAspectReverseSort        = 29;
  230.     kDETAspectInfoPageCustomWindow = 30;
  231.  
  232. { Properties: }
  233.     kDETNoProperty                = -1;
  234.  
  235. { Each aspect has 250 attribute properties in this range: }
  236.     kDETFirstLocalProperty        = 0;
  237.     kDETLastLocalProperty        = 0+(kDETFirstLocalProperty + 249);
  238.  
  239. { Developers should use property numbers starting at this point: }
  240.     kDETFirstDevProperty        = 40;
  241.  
  242. { The following range provides constant numeric properties for use in patterns and comparisons (constant n is
  243.   
  244.    given by kDETFirstConstantProperty+n): }
  245.     kDETFirstConstantProperty    = 250;
  246.     kDETLastConstantProperty    = 0+(kDETFirstConstantProperty + 249);
  247.  
  248. { To convert a number into a constant property, add this: }
  249.     kDETConstantProperty        = kDETFirstConstantProperty;
  250.     kDETZeroProperty            = 0+(kDETConstantProperty + 0);
  251.     kDETOneProperty                = 0+(kDETConstantProperty + 1);
  252.     kDETFalseProperty            = 0+(kDETConstantProperty + 0);
  253.     kDETTrueProperty            = 0+(kDETConstantProperty + 1);
  254.  
  255. { The following apply to records, attributes, or aliases; they are the name and kind, as they appear in icon lists: }
  256.     kDETPrName                    = 3050;
  257.     kDETPrKind                    = 3051;
  258.  
  259. { Access mask properties: }
  260.     kDETDNodeAccessMask            = 25825;                        { The DNode access mask }
  261.     kDETRecordAccessMask        = 25826;                        { The record access mask }
  262.     kDETAttributeAccessMask        = 25827;                        { The attribute access mask }
  263.     kDETPrimaryMaskByBit        = 25828;                        { A set of sixteen properties to access all bits of the primary mask }
  264.  
  265. { See AOCE documentation for details definitions of each of these bits: }
  266.     kDETPrimarySeeMask            = kDETPrimaryMaskByBit;
  267.     kDETPrimaryAddMask            = 0+(kDETPrimaryMaskByBit + 1);
  268.     kDETPrimaryDeleteMask        = 0+(kDETPrimaryMaskByBit + 2);
  269.     kDETPrimaryChangeMask        = 0+(kDETPrimaryMaskByBit + 3);
  270.     kDETPrimaryRenameMask        = 0+(kDETPrimaryMaskByBit + 4);
  271.     kDETPrimaryChangePrivsMask    = 0+(kDETPrimaryMaskByBit + 5);
  272.     kDETPrimaryTopMaskBit        = 0+(kDETPrimaryMaskByBit + 15);
  273.  
  274. { The following property is zero until we've completed the first catalog lookup; from then on it's 1 }
  275.     kDETPastFirstLookup            = 26550;
  276.  
  277. { The following property is the page number; issuing a property command with this property will flip info-pages }
  278.     kDETInfoPageNumber            = 27050;
  279.  
  280. { The value of the following properties contains the template number of the targeted aspect's template, and the
  281.    currently open info-page (if any). These values can be used with kDETAspectTemplate and kDETInfoPageTemplate
  282.    target selectors. }
  283.     kDETAspectTemplateNumber    = 26551;
  284.     kDETInfoPageTemplateNumber    = 26552;
  285.  
  286. { Properties for property commands to deal with sublist items: }
  287.     kDETOpenSelectedItems        = 26553;                        { Open selected sublist items }
  288.     kDETAddNewItem                = 26554;                        { Add new sublist item }
  289.     kDETRemoveSelectedItems        = 26555;                        { Remove selected sublist items }
  290.  
  291. { Property types are used to specify types of properties and conversions between types (zero and negative numbers
  292.    are reserved for Apple; developer code resources can use positive numbers): }
  293.     kDETPrTypeNumber            = -1;                            { A number }
  294.     kDETPrTypeString            = -2;                            { A string }
  295.     kDETPrTypeBinary            = -3;                            { A binary block }
  296.  
  297. { ************************************ Info-pages }
  298. { Info-pages include the following as well:
  299.  
  300.      Type    Offset                        Description
  301.      ----    ------                        -----------
  302.     'deti'    0                            Identifies the type of resource; see below for details on the contents
  303.     'rstr'    kDETInfoPageName            Is the name of the view to use in the page selection pop-up
  304.     'rstr'    kDETInfoPageMainViewAspect    Is the name of the aspect to use with the main page view
  305.     'rstr'    kDETInfoPageMenuName        Is the name of the catalogs menu ("Catalogs" if not present)
  306.     'detm'    kDETInfoPageMenuEntries        Are menu entries to go in the Catalogs menu
  307.  
  308. }
  309.     kDETInfoPageName            = 4;
  310.     kDETInfoPageMainViewAspect    = 5;
  311.     kDETInfoPageMenuName        = 6;
  312.     kDETInfoPageMenuEntries        = 7;
  313.  
  314. { ************************************ Views 
  315.  
  316.    Flags: }
  317.     kDETNoFlags                    = 0;
  318. { Main view (non-sublist) field enabled }
  319.     kDETEnabled                    = 0+(1 * (2**(0)));
  320.  
  321. { The following flags make sense for items in a sublist only }
  322. { Hilight view when entry is selected }
  323.     kDETHilightIfSelected        = 0+(1 * (2**(0)));
  324.  
  325. { The following flags make sense for text views only }
  326.     kDETNumericOnly                = 0+(1 * (2**(3)));                { Only allow the user to enter digits }
  327.     kDETMultiLine                = 0+(1 * (2**(4)));                { Allow multiple lines in view }
  328.     kDETDynamicSize                = 0+(1 * (2**(9)));                { Don't draw box around text until user clicks in it, then auto-size it
  329.      * Don't allow the user to enter colons (convert ":"s to "-"s) }
  330.     kDETAllowNoColons            = 0+(1 * (2**(10)));
  331.  
  332. { The following flags are used for pop-up menus only }
  333. { Automatically resize pop-up based on contents }
  334.     kDETPopupDynamicSize        = 0+(1 * (2**(8)));
  335.  
  336. { The following flags are used for EditPicture views only }
  337. { Scale picture to view bounds rather than cropping }
  338.     kDETScaleToView                = 0+(1 * (2**(8)));
  339.  
  340. {    Sizes for icons }
  341.     kDETLargeIcon                = 0;
  342.     kDETSmallIcon                = 1;
  343.     kDETMiniIcon                = 2;
  344.  
  345. { Stolen from TextEdit.h }
  346.     kDETLeft                    = 0;
  347.     kDETCenter                    = 1;
  348.     kDETRight                    = -1;
  349.     kDETForceLeft                = -2;
  350.  
  351. { Flags for use within Box view type attributes - these are distinct from the flags above }
  352.     kDETUnused                    = 0;
  353.     kDETBoxTakesContentClicks    = 0+(1 * (2**(0)));
  354.     kDETBoxIsRounded            = 0+(1 * (2**(1)));
  355.     kDETBoxIsGrayed                = 0+(1 * (2**(2)));
  356.     kDETBoxIsInvisible            = 0+(1 * (2**(3)));
  357.  
  358. { The common font info }
  359.     kDETApplicationFont            = 1;
  360.     kDETApplicationFontSize        = 9;
  361.     kDETAppFontLineHeight        = 12;
  362.     kDETSystemFont                = 0;
  363.     kDETSystemFontSize            = 12;
  364.     kDETSystemFontLineHeight    = 16;
  365.     kDETDefaultFont                = 1;
  366.     kDETDefaultFontSize            = 9;
  367.     kDETDefaultFontLineHeight    = 12;
  368.  
  369. {    These were taken from QuickDraw.h (where they're enums and therefore unusable in resource definitions): }
  370.     kDETNormal                    = 0;
  371.     kDETBold                    = 1;
  372.     kDETItalic                    = 2;
  373.     kDETUnderline                = 4;
  374.     kDETOutline                    = 8;
  375.     kDETShadow                    = $10;
  376.     kDETCondense                = $20;
  377.     kDETExtend                    = $40;
  378.  
  379.     kDETIconStyle                = -3;                            { Normal text style for regular sublist entries, italic text style for aliases }
  380.  
  381. { View menu: }
  382.     kDETChangeViewCommand        = 'view';
  383.  
  384. { Info-page window sizes: }
  385. { Default record info-pages: }
  386.     kDETRecordInfoWindHeight    = 228;
  387.     kDETRecordInfoWindWidth        = 400;
  388.  
  389. { Default attribute info-pages: }
  390.     kDETAttributeInfoWindHeight    = 250;
  391.     kDETAttributeInfoWindWidth    = 230;
  392.  
  393. { Page identifying icon (for default info-page layout): }
  394.     kDETSubpageIconTop            = 8;
  395.     kDETSubpageIconLeft            = 8;
  396.     kDETSubpageIconBottom        = 0+(kDETSubpageIconTop + 32);
  397.     kDETSubpageIconRight        = 0+(kDETSubpageIconLeft + 32);
  398.  
  399. { ************************************ Killers 
  400.  
  401.    Killers include the following as well:
  402.  
  403.      Type    Offset                        Description
  404.      ----    ------                        -----------
  405.     'detk'    0                            Identifies the type of resource; see below for details on the contents
  406.     'rst#'    kDETKillerName                Contains a list of template names to be killed
  407.  
  408. }
  409.     kDETKillerName                = 1;
  410.  
  411. { ************************************ Forwarders 
  412.  
  413.    Forwarders include the following as well:
  414.  
  415.      Type    Offset                        Description
  416.      ----    ------                        -----------
  417.     'detf'    0                            Identifies the type of resource; see below for details on the contents
  418.     'rst#'    kDETForwarderTemplateNames    Contains a list of names of templates to forward to
  419.  
  420. }
  421.     kDETForwarderTemplateNames    = 4;
  422.  
  423. { Target specification: }
  424.     kDETSelf                    = 0;                            { The "current" item }
  425.     kDETSelfOtherAspect            = 1;                            { Another aspect of the current item }
  426.     kDETParent                    = 2;                            { The parent (i.e., the aspect we're in the sublist of, if any) of the current item }
  427.     kDETSublistItem                = 3;                            { The itemNumberth item in the sublist }
  428.     kDETSelectedSublistItem        = 4;                            { The itemNumberth selected item in the sublist }
  429.     kDETDSSpec                    = 5;                            { The item specified by the packed DSSpec }
  430.     kDETAspectTemplate            = 6;                            { A specific aspect template (number itemNumber) }
  431.     kDETInfoPageTemplate        = 7;                            { A specific info-page template (number itemNumber)
  432.     *  Force type to be short }
  433.     kDETHighSelector            = $F000;
  434.  
  435.     
  436. TYPE
  437.     DETTargetSelector = LONGINT;
  438.  
  439.     DETTargetSpecification = RECORD
  440.         selector:                DETTargetSelector;                        { Target selection method (see above) }
  441.         aspectName:                RStringPtr;                                { The name of the aspect (kDETSelfOtherAspect, kDETSublistItem,
  442.                                            kDETSelectedSublistItem, kDETDSSpec); nil for main aspect or none;
  443.                                            always filled in for calls if there is an aspect, even if it's the main aspect }
  444.         itemNumber:                LONGINT;                                { Sublist index (kDETSublistItem & kDETSelectedSublistItem & kDETAspectTemplate);
  445.                                            1-based indexing }
  446.         dsSpec:                    PackedDSSpecPtr;                        { DSSpec (kDETDSSpec only) }
  447.     END;
  448.  
  449. { Code resource calls and call-backs both return an OSType:
  450.         kDETDidNotHandle (1)    = used by template to say "I didn't handle it" (for calls only)
  451.         noErr                    = function completed successfully
  452.         any error                = function failed, and here's why
  453. }
  454. {$SETC kDETDidNotHandle := 1}
  455.  
  456. CONST
  457.     kDETcmdSimpleCallback        = 0;
  458.     kDETcmdBeep                    = 1;
  459.     kDETcmdBusy                    = 2;
  460.     kDETcmdChangeCallFors        = 3;
  461.     kDETcmdGetCommandSelectionCount = 4;
  462.     kDETcmdGetCommandItemN        = 5;
  463.     kDETcmdOpenDSSpec            = 6;
  464.     kDETcmdAboutToTalk            = 7;
  465.     kDETcmdUnloadTemplates        = 8;
  466.     kDETcmdTemplateCounts        = 9;
  467.     kDETcmdTargetedCallback        = 1000;
  468.     kDETcmdGetDSSpec            = 1001;
  469.     kDETcmdSublistCount            = 1002;
  470.     kDETcmdSelectedSublistCount    = 1003;
  471.     kDETcmdRequestSync            = 1004;
  472.     kDETcmdBreakAttribute        = 1005;
  473.     kDETcmdGetTemplateFSSpec    = 1006;
  474.     kDETcmdGetOpenEdit            = 1007;
  475.     kDETcmdCloseEdit            = 1008;
  476.     kDETcmdPropertyCallback        = 2000;
  477.     kDETcmdGetPropertyType        = 2001;
  478.     kDETcmdGetPropertyNumber    = 2002;
  479.     kDETcmdGetPropertyRString    = 2003;
  480.     kDETcmdGetPropertyBinarySize = 2004;
  481.     kDETcmdGetPropertyBinary    = 2005;
  482.     kDETcmdGetPropertyChanged    = 2006;
  483.     kDETcmdGetPropertyEditable    = 2007;
  484.     kDETcmdSetPropertyType        = 2008;
  485.     kDETcmdSetPropertyNumber    = 2009;
  486.     kDETcmdSetPropertyRString    = 2010;
  487.     kDETcmdSetPropertyBinary    = 2011;
  488.     kDETcmdSetPropertyChanged    = 2012;
  489.     kDETcmdSetPropertyEditable    = 2013;
  490.     kDETcmdDirtyProperty        = 2014;
  491.     kDETcmdDoPropertyCommand    = 2015;
  492.     kDETcmdAddMenu                = 2016;
  493.     kDETcmdRemoveMenu            = 2017;
  494.     kDETcmdMenuItemRString        = 2018;
  495.     kDETcmdSaveProperty            = 2019;
  496.     kDETcmdGetCustomViewUserReference = 2020;
  497.     kDETcmdGetCustomViewBounds    = 2021;
  498.     kDETcmdGetResource            = 2022;
  499. { Force type to be long }
  500.     kDETcmdHighCallback            = $F0000000;
  501.  
  502.     
  503. TYPE
  504.     DETCallBackFunctions = LONGINT;
  505.  
  506.     DETProtoCallBackBlock = RECORD
  507.         reqFunction:            DETCallBackFunctions;
  508.         target:                    DETTargetSpecification;
  509.         property:                INTEGER;
  510.     END;
  511.  
  512.     DETBeepBlock = RECORD
  513.         reqFunction:            DETCallBackFunctions;
  514.     END;
  515.  
  516.     DETBusyBlock = RECORD
  517.         reqFunction:            DETCallBackFunctions;
  518.     END;
  519.  
  520.     DETChangeCallForsBlock = RECORD
  521.         reqFunction:            DETCallBackFunctions;
  522.         target:                    DETTargetSpecification;
  523.         newCallFors:            LONGINT;                                {  -> New call-for mask }
  524.     END;
  525.  
  526.     DETGetCommandSelectionCountBlock = RECORD
  527.         reqFunction:            DETCallBackFunctions;
  528.         count:                    LONGINT;                                { <-  The number of items in the command selection list }
  529.     END;
  530.  
  531.  
  532. CONST
  533.     kDETHFSType                    = 0;                            { HFS item type }
  534.     kDETDSType                    = 1;                            { Catalog Service item type }
  535.     kDETMailType                = 2;                            { Mail (letter) item type }
  536.     kDETMoverType                = 3;                            { Sounds, fonts, etc., from inside a suitcase or system file }
  537.     kDETLastItemType            = $F0000000;                    { Force it to be a long (C & C++ seem to disagree about the definition of 0xF000) }
  538.  
  539.     
  540. TYPE
  541.     DETItemType = LONGINT;
  542.  
  543. { FSSpec plus possibly interesting additional info }
  544.     DETFSInfo = RECORD
  545.         fileType:                OSType;                                    { File type }
  546.         fileCreator:            OSType;                                    { File creator }
  547.         fdFlags:                INTEGER;                                { Finder flags }
  548.         fsSpec:                    FSSpec;                                    { FSSpec }
  549.     END;
  550.  
  551.     DSRec = RECORD
  552.         dsSpec:                    ^PackedDSSpecPtr;                        { <-  DSSpec for item (caller must DisposHandle() when done) }
  553.         refNum:                    INTEGER;                                { <-  Refnum for returned address }
  554.         identity:                AuthIdentity;                            { <-  Identity for returned address }
  555.     END;
  556.  
  557.     DETFSInfoPtr = ^DETFSInfo;
  558.  
  559.     LetterSpecPtr = ^LetterSpec;
  560.  
  561.     ItemRec = RECORD
  562.         CASE INTEGER OF
  563.         0: (
  564.             fsInfo:                        ^DETFSInfoPtr;                        { <-  FSSpec & info for item (caller must DisposHandle() when done) }
  565.            );
  566.         1: (
  567.             ds:                            DSRec;
  568.            );
  569.         2: (
  570.             dsSpec:                        ^PackedDSSpecPtr;                    { <-  DSSpec for item (caller must DisposHandle() when done) }
  571.            );
  572.         3: (
  573.             ltrSpec:                    ^LetterSpecPtr;                        { <-  Letter spec for item (caller must DisposHandle() when done) }
  574.            );
  575.     END;
  576.  
  577.     DETGetCommandItemNBlock = RECORD
  578.         reqFunction:            DETCallBackFunctions;
  579.         itemNumber:                LONGINT;                                {  -> Item number to retrieve (1-based) }
  580.         itemType:                DETItemType;                            {  -> Type of item to be returned (if we can interpret it as such) }
  581.         item:                    ItemRec;
  582.     END;
  583.  
  584.     DETGetDSSpecBlock = RECORD
  585.         reqFunction:            DETCallBackFunctions;
  586.         target:                    DETTargetSpecification;
  587.         dsSpec:                    ^PackedDSSpecPtr;                        { <-  Handle with result (caller must DisposHandle() when done) }
  588.         refNum:                    INTEGER;                                { <-  Refnum for address if PD }
  589.         identity:                AuthIdentity;                            { <-  Identity for address }
  590.         isAlias:                BOOLEAN;                                { <-  True if this entry is an alias }
  591.         isRecordRef:            BOOLEAN;                                { <-  True if this entry is a record reference (reserved) }
  592.     END;
  593.  
  594.     DETGetTemplateFSSpecBlock = RECORD
  595.         reqFunction:            DETCallBackFunctions;
  596.         target:                    DETTargetSpecification;
  597.         fsSpec:                    FSSpec;                                    { <-  FSSpec of template file }
  598.         baseID:                    INTEGER;                                { <-  Base ID of this template }
  599.         aspectTemplateNumber:    LONGINT;                                { <-  The template number for this aspect template }
  600.     END;
  601.  
  602.     DETGetOpenEditBlock = RECORD
  603.         reqFunction:            DETCallBackFunctions;
  604.         target:                    DETTargetSpecification;
  605.         viewProperty:            INTEGER;                                { <-  The property of the view being edited (or kNoProperty if none) }
  606.     END;
  607.  
  608.     DETCloseEditBlock = RECORD
  609.         reqFunction:            DETCallBackFunctions;
  610.         target:                    DETTargetSpecification;
  611.     END;
  612.  
  613.     DETGetPropertyTypeBlock = RECORD
  614.         reqFunction:            DETCallBackFunctions;
  615.         target:                    DETTargetSpecification;
  616.         property:                INTEGER;
  617.         propertyType:            INTEGER;                                { <-  The type of the property }
  618.     END;
  619.  
  620.     DETGetPropertyNumberBlock = RECORD
  621.         reqFunction:            DETCallBackFunctions;
  622.         target:                    DETTargetSpecification;
  623.         property:                INTEGER;
  624.         propertyValue:            LONGINT;                                { <-  The value of the property }
  625.     END;
  626.  
  627.     DETGetPropertyRStringBlock = RECORD
  628.         reqFunction:            DETCallBackFunctions;
  629.         target:                    DETTargetSpecification;
  630.         property:                INTEGER;
  631.         propertyValue:            RStringHandle;                            { <-  A handle containing the property (as an RString) (caller must DisposHandle() when done) }
  632.     END;
  633.  
  634.     DETGetPropertyBinarySizeBlock = RECORD
  635.         reqFunction:            DETCallBackFunctions;
  636.         target:                    DETTargetSpecification;
  637.         property:                INTEGER;
  638.         propertyBinarySize:        LONGINT;                                { <-  The size of the property as a binary block }
  639.     END;
  640.  
  641.     DETGetPropertyBinaryBlock = RECORD
  642.         reqFunction:            DETCallBackFunctions;
  643.         target:                    DETTargetSpecification;
  644.         property:                INTEGER;
  645.         propertyValue:            Handle;                                    { <-  Handle with the value of the property (caller must DisposHandle() when done) }
  646.     END;
  647.  
  648.     DETGetPropertyChangedBlock = RECORD
  649.         reqFunction:            DETCallBackFunctions;
  650.         target:                    DETTargetSpecification;
  651.         property:                INTEGER;
  652.         propertyChanged:        BOOLEAN;                                { <-  True if the property is marked as changed }
  653.         filler1:                BOOLEAN;
  654.     END;
  655.  
  656.     DETGetPropertyEditableBlock = RECORD
  657.         reqFunction:            DETCallBackFunctions;
  658.         target:                    DETTargetSpecification;
  659.         property:                INTEGER;
  660.         propertyEditable:        BOOLEAN;                                { <-  True if the property can be edited by the user (if false, view will appear disabled) }
  661.         filler1:                BOOLEAN;
  662.     END;
  663.  
  664.     DETSetPropertyTypeBlock = RECORD
  665.         reqFunction:            DETCallBackFunctions;
  666.         target:                    DETTargetSpecification;
  667.         property:                INTEGER;
  668.         newType:                INTEGER;                                {  -> New type for property (just sets type, does not convert contents) }
  669.     END;
  670.  
  671.     DETSetPropertyNumberBlock = RECORD
  672.         reqFunction:            DETCallBackFunctions;
  673.         target:                    DETTargetSpecification;
  674.         property:                INTEGER;
  675.         newValue:                LONGINT;                                {  -> New value to set property to (and set type to number) }
  676.     END;
  677.  
  678.     DETSetPropertyRStringBlock = RECORD
  679.         reqFunction:            DETCallBackFunctions;
  680.         target:                    DETTargetSpecification;
  681.         property:                INTEGER;
  682.         newValue:                RStringPtr;                                {  -> New value to set property to (and set type to RString) }
  683.     END;
  684.  
  685.     DETSetPropertyBinaryBlock = RECORD
  686.         reqFunction:            DETCallBackFunctions;
  687.         target:                    DETTargetSpecification;
  688.         property:                INTEGER;
  689.         newValue:                Ptr;                                    {  -> New value to set property to (and set type to binary) }
  690.         newValueSize:            LONGINT;                                {  -> Size of new value }
  691.     END;
  692.  
  693.     DETSetPropertyChangedBlock = RECORD
  694.         reqFunction:            DETCallBackFunctions;
  695.         target:                    DETTargetSpecification;
  696.         property:                INTEGER;
  697.         propertyChanged:        BOOLEAN;                                {  -> Value to set changed flag on property to }
  698.         filler1:                BOOLEAN;
  699.     END;
  700.  
  701.     DETSetPropertyEditableBlock = RECORD
  702.         reqFunction:            DETCallBackFunctions;
  703.         target:                    DETTargetSpecification;
  704.         property:                INTEGER;
  705.         propertyEditable:        BOOLEAN;                                {  -> Value to set editable flag on property to }
  706.         filler1:                BOOLEAN;
  707.     END;
  708.  
  709.     DETDirtyPropertyBlock = RECORD
  710.         reqFunction:            DETCallBackFunctions;
  711.         target:                    DETTargetSpecification;
  712.         property:                INTEGER;
  713.     END;
  714.  
  715.     DETDoPropertyCommandBlock = RECORD
  716.         reqFunction:            DETCallBackFunctions;
  717.         target:                    DETTargetSpecification;
  718.         property:                INTEGER;
  719.         parameter:                LONGINT;                                { ->  Parameter of command }
  720.     END;
  721.  
  722.     DETSublistCountBlock = RECORD
  723.         reqFunction:            DETCallBackFunctions;
  724.         target:                    DETTargetSpecification;
  725.         count:                    LONGINT;                                { <-  The number of items in the current item's sublist }
  726.     END;
  727.  
  728.     DETSelectedSublistCountBlock = RECORD
  729.         reqFunction:            DETCallBackFunctions;
  730.         target:                    DETTargetSpecification;
  731.         count:                    LONGINT;                                { <-  The number of selected items in the current item's sublist }
  732.     END;
  733.  
  734.     DETRequestSyncBlock = RECORD
  735.         reqFunction:            DETCallBackFunctions;
  736.         target:                    DETTargetSpecification;
  737.     END;
  738.  
  739.     DETAddMenuBlock = RECORD
  740.         reqFunction:            DETCallBackFunctions;
  741.         target:                    DETTargetSpecification;
  742.         property:                INTEGER;
  743.         name:                    ^RString;                                {  -> Name of new menu item }
  744.         parameter:                LONGINT;                                {  -> Parameter to return when this item is selected }
  745.         addAfter:                LONGINT;                                {  -> Parameter of entry to add after, or -1 for add at end }
  746.     END;
  747.  
  748.     DETRemoveMenuBlock = RECORD
  749.         reqFunction:            DETCallBackFunctions;
  750.         target:                    DETTargetSpecification;
  751.         property:                INTEGER;
  752.         itemToRemove:            LONGINT;                                {  -> Parameter of menu item to remove }
  753.     END;
  754.  
  755.     DETMenuItemRStringBlock = RECORD
  756.         reqFunction:            DETCallBackFunctions;
  757.         target:                    DETTargetSpecification;
  758.         property:                INTEGER;
  759.         itemParameter:            LONGINT;                                {  -> Parameter of menu item to return string for }
  760.         rString:                RStringHandle;                            { <-  Handle with the RString (caller must DisposHandle() when done) }
  761.     END;
  762.  
  763.     DETOpenDSSpecBlock = RECORD
  764.         reqFunction:            DETCallBackFunctions;
  765.         dsSpec:                    PackedDSSpecPtr;                        {  -> DSSpec of object to be opened }
  766.     END;
  767.  
  768.     DETAboutToTalkBlock = RECORD
  769.         reqFunction:            DETCallBackFunctions;
  770.     END;
  771.  
  772.     DETBreakAttributeBlock = RECORD
  773.         reqFunction:            DETCallBackFunctions;
  774.         target:                    DETTargetSpecification;
  775.         breakAttribute:            AttributePtr;                            {  -> Attribute to parse }
  776.         isChangeable:            BOOLEAN;                                {  -> True if the value can be changed by the user }
  777.         filler1:                BOOLEAN;
  778.     END;
  779.  
  780.     DETSavePropertyBlock = RECORD
  781.         reqFunction:            DETCallBackFunctions;
  782.         target:                    DETTargetSpecification;
  783.         property:                INTEGER;
  784.     END;
  785.  
  786.     DETGetCustomViewUserReferenceBlock = RECORD
  787.         reqFunction:            DETCallBackFunctions;
  788.         target:                    DETTargetSpecification;
  789.         property:                INTEGER;
  790.         userReference:            INTEGER;                                { <-  User reference value, as specified in the .r file }
  791.     END;
  792.  
  793.     DETGetCustomViewBoundsBlock = RECORD
  794.         reqFunction:            DETCallBackFunctions;
  795.         target:                    DETTargetSpecification;
  796.         property:                INTEGER;
  797.         bounds:                    Rect;                                    { <-  Bounds of the view }
  798.     END;
  799.  
  800.     DETGetResourceBlock = RECORD
  801.         reqFunction:            DETCallBackFunctions;
  802.         target:                    DETTargetSpecification;
  803.         property:                INTEGER;
  804.         resourceType:            ResType;                                {  -> Resource type }
  805.         theResource:            Handle;                                    { <-  The resource handle (caller must dispose when done) }
  806.     END;
  807.  
  808.     DETTemplateCounts = RECORD
  809.         reqFunction:            DETCallBackFunctions;
  810.         aspectTemplateCount:    LONGINT;                                { <-  Number of aspect templates in the system }
  811.         infoPageTemplateCount:    LONGINT;                                { <-  Number of info-page templates in the system }
  812.     END;
  813.  
  814.     DETUnloadTemplatesBlock = RECORD
  815.         reqFunction:            DETCallBackFunctions;
  816.     END;
  817.  
  818.     DETCallBackBlock = RECORD
  819.         CASE INTEGER OF
  820.         0: (
  821.             protoCallBack:                DETProtoCallBackBlock;
  822.            );
  823.         1: (
  824.             beep:                        DETBeepBlock;
  825.            );
  826.         2: (
  827.             busy:                        DETBusyBlock;
  828.            );
  829.         3: (
  830.             changeCallFors:                DETChangeCallForsBlock;
  831.            );
  832.         4: (
  833.             getCommandSelectionCount:    DETGetCommandSelectionCountBlock;
  834.            );
  835.         5: (
  836.             getCommandItemN:            DETGetCommandItemNBlock;
  837.            );
  838.         6: (
  839.             getDSSpec:                    DETGetDSSpecBlock;
  840.            );
  841.         7: (
  842.             getTemplateFSSpec:            DETGetTemplateFSSpecBlock;
  843.            );
  844.         8: (
  845.             getOpenEdit:                DETGetOpenEditBlock;
  846.            );
  847.         9: (
  848.             closeEdit:                    DETCloseEditBlock;
  849.            );
  850.         10: (
  851.             getPropertyType:            DETGetPropertyTypeBlock;
  852.            );
  853.         11: (
  854.             getPropertyNumber:            DETGetPropertyNumberBlock;
  855.            );
  856.         12: (
  857.             getPropertyRString:            DETGetPropertyRStringBlock;
  858.            );
  859.         13: (
  860.             getPropertyBinarySize:        DETGetPropertyBinarySizeBlock;
  861.            );
  862.         14: (
  863.             getPropertyBinary:            DETGetPropertyBinaryBlock;
  864.            );
  865.         15: (
  866.             getPropertyChanged:            DETGetPropertyChangedBlock;
  867.            );
  868.         16: (
  869.             getPropertyEditable:        DETGetPropertyEditableBlock;
  870.            );
  871.         17: (
  872.             setPropertyType:            DETSetPropertyTypeBlock;
  873.            );
  874.         18: (
  875.             setPropertyNumber:            DETSetPropertyNumberBlock;
  876.            );
  877.         19: (
  878.             setPropertyRString:            DETSetPropertyRStringBlock;
  879.            );
  880.         20: (
  881.             setPropertyBinary:            DETSetPropertyBinaryBlock;
  882.            );
  883.         21: (
  884.             setPropertyChanged:            DETSetPropertyChangedBlock;
  885.            );
  886.         22: (
  887.             setPropertyEditable:        DETSetPropertyEditableBlock;
  888.            );
  889.         23: (
  890.             dirtyProperty:                DETDirtyPropertyBlock;
  891.            );
  892.         24: (
  893.             doPropertyCommand:            DETDoPropertyCommandBlock;
  894.            );
  895.         25: (
  896.             sublistCount:                DETSublistCountBlock;
  897.            );
  898.         26: (
  899.             selectedSublistCount:        DETSelectedSublistCountBlock;
  900.            );
  901.         27: (
  902.             requestSync:                DETRequestSyncBlock;
  903.            );
  904.         28: (
  905.             addMenu:                    DETAddMenuBlock;
  906.            );
  907.         29: (
  908.             removeMenu:                    DETRemoveMenuBlock;
  909.            );
  910.         30: (
  911.             menuItemRString:            DETMenuItemRStringBlock;
  912.            );
  913.         31: (
  914.             openDSSpec:                    DETOpenDSSpecBlock;
  915.            );
  916.         32: (
  917.             aboutToTalk:                DETAboutToTalkBlock;
  918.            );
  919.         33: (
  920.             breakAttribute:                DETBreakAttributeBlock;
  921.            );
  922.         34: (
  923.             saveProperty:                DETSavePropertyBlock;
  924.            );
  925.         35: (
  926.             getCustomViewUserReference:    DETGetCustomViewUserReferenceBlock;
  927.            );
  928.         36: (
  929.             getCustomViewBounds:        DETGetCustomViewBoundsBlock;
  930.            );
  931.         37: (
  932.             getResource:                DETGetResourceBlock;
  933.            );
  934.         38: (
  935.             templateCounts:                DETTemplateCounts;
  936.            );
  937.         39: (
  938.             unloadTemplates:            DETUnloadTemplatesBlock;
  939.            );
  940.     END;
  941.  
  942.     DETCallBackBlockPtr = ^DETCallBackBlock;
  943.  
  944.     DETCallBackProcPtr = ProcPtr;  { FUNCTION DETCallBack(VAR callBlockPtr: DETCallBlock; callBackBlockPtr: DETCallBackBlockPtr): OSErr; }
  945.     DETCallBackUPP = UniversalProcPtr;
  946.  
  947.     DETCallBack = DETCallBackUPP;
  948.  
  949. { Call functions:
  950.  
  951.         reqFunction                        Action
  952.         -----------                        ------
  953.         kDETcmdInit                        Called once when template is first loaded (good time to allocate private data); returns call-for list
  954.         kDETcmdExit                        Called once when template is freed (good time to free private data)
  955.  
  956.         kDETcmdAttributeCreation        New sublist attribute creation about to occur; this gives the template a chance to modify
  957.                                         the value that's about to be created; sent to the template that will be used for
  958.                                         the main aspect of the new entry
  959.  
  960.         kDETcmdDynamicForwarders        Return a list of dynamically created forwarders
  961.  
  962.         kDETcmdInstanceInit                Called once when instance of template is started (good time to allocate private instance data)
  963.         kDETcmdInstanceExit                Called once when instance is ended (good time to free private instance data)
  964.  
  965.         kDETcmdIdle                        Called periodically during idle times
  966.  
  967.         kDETcmdViewListChanged            Called when the info-page view-list (list of enabled views) has changed
  968.  
  969.         kDETcmdValidateSave                Validate save: about to save info-page, return noErr (or kDETDidNotHandle) if it's OK to do so
  970.  
  971.         kDETcmdDropQuery                Drop query: return the appropriate operation for this drag; ask destination
  972.         kDETcmdDropMeQuery                Drop query: return the appropriate operation for this drag; ask dropee
  973.  
  974.         kDETcmdAttributeNew                Attribute value new (return kDETDidNotHandle to let normal new processing occur)
  975.         kDETcmdAttributeChange            Attribute value change (return kDETDidNotHandle to let normal change processing occur)
  976.         kDETcmdAttributeDelete            Attribute value delete (return kDETDidNotHandle to let normal deletion occur); sent to the
  977.                                         main aspect of the attribute that's about to be deleted
  978.         kDETcmdItemNew                    Target item (record or attribute) has just been created
  979.  
  980.         kDETcmdOpenSelf                    Self open (return noErr to prevent opening; return kDETDidNotHandle to allow it)
  981.  
  982.         kDETcmdDynamicResource            Return a dynamically created resource
  983.  
  984.         kDETcmdShouldSync                Check if the code resource wants to force a sync (update data from catalog)
  985.         kDETcmdDoSync                    Give code resource a chance to sync (read in and break all attributes)
  986.  
  987.         kDETcmdPropertyCommand            Command received in the property number range (usually means a button's been pushed)
  988.  
  989.         kDETcmdMaximumTextLength        Return maximum size for text form of property
  990.  
  991.         kDETcmdPropertyDirtied            Property dirtied, need to redraw
  992.  
  993.         kDETcmdPatternIn                Custom pattern element encountered on reading in an attribute
  994.         kDETcmdPatternOut                Custom pattern element encountered on writing out an attribute
  995.  
  996.         kDETcmdConvertToNumber            Convert from template-defined property type to number
  997.         kDETcmdConvertToRString            Convert from template-defined property type to RString
  998.         kDETcmdConvertFromNumber        Convert from number to template-defined property type
  999.         kDETcmdConvertFromRString        Convert from RString to template-defined property type
  1000.  
  1001.         kDETcmdCustomViewDraw            Custom view draw
  1002.         kDETcmdCustomViewMouseDown        Custom view mouse down
  1003.  
  1004.         kDETcmdKeyPress                    Key press (used primarily to filter entry into EditText views)
  1005.         kDETcmdPaste                    Paste (used primarily to filter entry into EditText views)
  1006.  
  1007.         kDETcmdCustomMenuSelected        Custom Catalogs menu selected
  1008.         kDETcmdCustomMenuEnabled        Return whether custom Catalogs menu entry should be enabled
  1009. }
  1010.  
  1011. CONST
  1012.     kDETcmdSimpleCall            = 0;
  1013.     kDETcmdInit                    = 1;
  1014.     kDETcmdExit                    = 2;
  1015.     kDETcmdAttributeCreation    = 3;
  1016.     kDETcmdDynamicForwarders    = 4;
  1017.     kDETcmdTargetedCall            = 1000;
  1018.     kDETcmdInstanceInit            = 1001;
  1019.     kDETcmdInstanceExit            = 1002;
  1020.     kDETcmdIdle                    = 1003;
  1021.     kDETcmdViewListChanged        = 1004;
  1022.     kDETcmdValidateSave            = 1005;
  1023.     kDETcmdDropQuery            = 1006;
  1024.     kDETcmdDropMeQuery            = 1007;
  1025.     kDETcmdAttributeNew            = 1008;
  1026.     kDETcmdAttributeChange        = 1009;
  1027.     kDETcmdAttributeDelete        = 1010;
  1028.     kDETcmdItemNew                = 1011;
  1029.     kDETcmdOpenSelf                = 1012;
  1030.     kDETcmdDynamicResource        = 1013;
  1031.     kDETcmdShouldSync            = 1014;
  1032.     kDETcmdDoSync                = 1015;
  1033.     kDETcmdPropertyCall            = 2000;
  1034.     kDETcmdPropertyCommand        = 2001;
  1035.     kDETcmdMaximumTextLength    = 2002;
  1036.     kDETcmdPropertyDirtied        = 2003;
  1037.     kDETcmdPatternIn            = 2004;
  1038.     kDETcmdPatternOut            = 2005;
  1039.     kDETcmdConvertToNumber        = 2006;
  1040.     kDETcmdConvertToRString        = 2007;
  1041.     kDETcmdConvertFromNumber    = 2008;
  1042.     kDETcmdConvertFromRString    = 2009;
  1043.     kDETcmdCustomViewDraw        = 2010;
  1044.     kDETcmdCustomViewMouseDown    = 2011;
  1045.     kDETcmdKeyPress                = 2012;
  1046.     kDETcmdPaste                = 2013;
  1047.     kDETcmdCustomMenuSelected    = 2014;
  1048.     kDETcmdCustomMenuEnabled    = 2015;
  1049.     kDETcmdHighCall                = $F0000000;                    { Force the type to be long }
  1050.  
  1051.     
  1052. TYPE
  1053.     DETCallFunctions = LONGINT;
  1054.  
  1055.     DETProtoCallBlock = RECORD
  1056.         reqFunction:            DETCallFunctions;
  1057.         callBack:                DETCallBack;
  1058.         callBackPrivate:        LONGINT;
  1059.         templatePrivate:        LONGINT;
  1060.         instancePrivate:        LONGINT;
  1061.         target:                    DETTargetSpecification;
  1062.         targetIsMainAspect:        BOOLEAN;
  1063.         filler1:                BOOLEAN;
  1064.         property:                INTEGER;
  1065.     END;
  1066.  
  1067.     DETInitBlock = RECORD
  1068.         reqFunction:            DETCallFunctions;
  1069.         callBack:                DETCallBack;
  1070.         callBackPrivate:        LONGINT;
  1071.         templatePrivate:        LONGINT;
  1072.         newCallFors:            LONGINT;                                { <-  New call-for mask }
  1073.     END;
  1074.  
  1075.     DETExitBlock = RECORD
  1076.         reqFunction:            DETCallFunctions;
  1077.         callBack:                DETCallBack;
  1078.         callBackPrivate:        LONGINT;
  1079.         templatePrivate:        LONGINT;
  1080.     END;
  1081.  
  1082.     DETInstanceInitBlock = RECORD
  1083.         reqFunction:            DETCallFunctions;
  1084.         callBack:                DETCallBack;
  1085.         callBackPrivate:        LONGINT;
  1086.         templatePrivate:        LONGINT;
  1087.         instancePrivate:        LONGINT;
  1088.         target:                    DETTargetSpecification;
  1089.         targetIsMainAspect:        BOOLEAN;
  1090.         filler1:                BOOLEAN;
  1091.     END;
  1092.  
  1093.     DETInstanceExitBlock = RECORD
  1094.         reqFunction:            DETCallFunctions;
  1095.         callBack:                DETCallBack;
  1096.         callBackPrivate:        LONGINT;
  1097.         templatePrivate:        LONGINT;
  1098.         instancePrivate:        LONGINT;
  1099.         target:                    DETTargetSpecification;
  1100.         targetIsMainAspect:        BOOLEAN;
  1101.         filler1:                BOOLEAN;
  1102.     END;
  1103.  
  1104.     DETInstanceIdleBlock = RECORD
  1105.         reqFunction:            DETCallFunctions;
  1106.         callBack:                DETCallBack;
  1107.         callBackPrivate:        LONGINT;
  1108.         templatePrivate:        LONGINT;
  1109.         instancePrivate:        LONGINT;
  1110.         target:                    DETTargetSpecification;
  1111.         targetIsMainAspect:        BOOLEAN;
  1112.         filler1:                BOOLEAN;
  1113.     END;
  1114.  
  1115.     DETPropertyCommandBlock = RECORD
  1116.         reqFunction:            DETCallFunctions;
  1117.         callBack:                DETCallBack;
  1118.         callBackPrivate:        LONGINT;
  1119.         templatePrivate:        LONGINT;
  1120.         instancePrivate:        LONGINT;
  1121.         target:                    DETTargetSpecification;
  1122.         targetIsMainAspect:        BOOLEAN;
  1123.         filler1:                BOOLEAN;
  1124.         property:                INTEGER;
  1125.         parameter:                LONGINT;                                {  -> Parameter of command }
  1126.     END;
  1127.  
  1128.     DETMaximumTextLengthBlock = RECORD
  1129.         reqFunction:            DETCallFunctions;
  1130.         callBack:                DETCallBack;
  1131.         callBackPrivate:        LONGINT;
  1132.         templatePrivate:        LONGINT;
  1133.         instancePrivate:        LONGINT;
  1134.         target:                    DETTargetSpecification;
  1135.         targetIsMainAspect:        BOOLEAN;
  1136.         filler1:                BOOLEAN;
  1137.         property:                INTEGER;
  1138.         maxSize:                LONGINT;                                { <-  Return the maximum number of characters the user can entry when property is edited in an EditText }
  1139.     END;
  1140.  
  1141.     DETViewListChangedBlock = RECORD
  1142.         reqFunction:            DETCallFunctions;
  1143.         callBack:                DETCallBack;
  1144.         callBackPrivate:        LONGINT;
  1145.         templatePrivate:        LONGINT;
  1146.         instancePrivate:        LONGINT;
  1147.         target:                    DETTargetSpecification;
  1148.         targetIsMainAspect:        BOOLEAN;
  1149.         filler1:                BOOLEAN;
  1150.     END;
  1151.  
  1152.     DETPropertyDirtiedBlock = RECORD
  1153.         reqFunction:            DETCallFunctions;
  1154.         callBack:                DETCallBack;
  1155.         callBackPrivate:        LONGINT;
  1156.         templatePrivate:        LONGINT;
  1157.         instancePrivate:        LONGINT;
  1158.         target:                    DETTargetSpecification;
  1159.         targetIsMainAspect:        BOOLEAN;
  1160.         filler1:                BOOLEAN;
  1161.         property:                INTEGER;
  1162.     END;
  1163.  
  1164.     DETValidateSaveBlock = RECORD
  1165.         reqFunction:            DETCallFunctions;
  1166.         callBack:                DETCallBack;
  1167.         callBackPrivate:        LONGINT;
  1168.         templatePrivate:        LONGINT;
  1169.         instancePrivate:        LONGINT;
  1170.         target:                    DETTargetSpecification;
  1171.         targetIsMainAspect:        BOOLEAN;
  1172.         filler1:                BOOLEAN;
  1173.         errorString:            RStringHandle;                            { <-  Handle with error string if validation fails (callee must allocate handle, DE will DisposHandle() it) }
  1174.     END;
  1175.  
  1176. { Valid commandIDs for DETDropQueryBlock and DETDropMeQueryBlock (in addition to property numbers): }
  1177.  
  1178. CONST
  1179.     kDETDoNothing                = 'xxx0';
  1180.     kDETMove                    = 'move';
  1181.     kDETDrag                    = 'drag';
  1182.     kDETAlias                    = 'alis';
  1183.  
  1184.  
  1185. TYPE
  1186.     DETDropQueryBlock = RECORD
  1187.         reqFunction:            DETCallFunctions;
  1188.         callBack:                DETCallBack;
  1189.         callBackPrivate:        LONGINT;
  1190.         templatePrivate:        LONGINT;
  1191.         instancePrivate:        LONGINT;
  1192.         target:                    DETTargetSpecification;
  1193.         targetIsMainAspect:        BOOLEAN;
  1194.         filler1:                BOOLEAN;
  1195.         modifiers:                INTEGER;                                {  -> Modifiers at drop time (option/control/command/shift keys) }
  1196.         commandID:                LONGINT;                                { <-> Command ID (kDETDoNothing, kDETMove, kDETDrag (copy), kDETAlias, or a property number) }
  1197.         destinationType:        AttributeType;                            { <-> Type to convert attribute to }
  1198.         copyToHFS:                BOOLEAN;                                { <-  If true, object should be copied to HFS before being operated on, and deleted after }
  1199.         filler2:                BOOLEAN;
  1200.     END;
  1201.  
  1202.     DETDropMeQueryBlock = RECORD
  1203.         reqFunction:            DETCallFunctions;
  1204.         callBack:                DETCallBack;
  1205.         callBackPrivate:        LONGINT;
  1206.         templatePrivate:        LONGINT;
  1207.         instancePrivate:        LONGINT;
  1208.         target:                    DETTargetSpecification;
  1209.         targetIsMainAspect:        BOOLEAN;
  1210.         filler1:                BOOLEAN;
  1211.         modifiers:                INTEGER;                                {  -> Modifiers at drop time (option/control/command/shift keys) }
  1212.         commandID:                LONGINT;                                { <-> Command ID (kDETDoNothing, kDETMove, kDETDrag (copy), kDETAlias, or a property number) }
  1213.         destinationType:        AttributeType;                            { <-> Type to convert attribute to }
  1214.         copyToHFS:                BOOLEAN;                                { <-  If true, object should be copied to HFS before being operated on, and deleted after }
  1215.         filler2:                BOOLEAN;
  1216.     END;
  1217.  
  1218.     DETAttributeCreationBlock = RECORD
  1219.         reqFunction:            DETCallFunctions;
  1220.         callBack:                DETCallBack;
  1221.         callBackPrivate:        LONGINT;
  1222.         templatePrivate:        LONGINT;
  1223.         parent:                    PackedDSSpecPtr;                        {  -> The object within which the creation will occur }
  1224.         refNum:                    INTEGER;                                {  -> Refnum for returned address (DSSpecs in PDs only) }
  1225.         identity:                AuthIdentity;                            {  -> The identity we're browsing as in the parent object }
  1226.         attrType:                AttributeType;                            { <-> The type of the attribute being created }
  1227.         attrTag:                AttributeTag;                            { <-> The tag of the attribute being created }
  1228.         value:                    Handle;                                    { <-> The value to write (pre-allocated, resize as needed) }
  1229.     END;
  1230.  
  1231.     DETAttributeNewBlock = RECORD
  1232.         reqFunction:            DETCallFunctions;
  1233.         callBack:                DETCallBack;
  1234.         callBackPrivate:        LONGINT;
  1235.         templatePrivate:        LONGINT;
  1236.         instancePrivate:        LONGINT;
  1237.         target:                    DETTargetSpecification;
  1238.         targetIsMainAspect:        BOOLEAN;
  1239.         filler1:                BOOLEAN;
  1240.         parent:                    PackedDSSpecPtr;                        {  -> The object within which the creation will occur }
  1241.         refNum:                    INTEGER;                                {  -> Refnum for returned address (DSSpecs in PDs only) }
  1242.         identity:                AuthIdentity;                            {  -> The identity we're browsing as in the parent object }
  1243.         attrType:                AttributeType;                            { <-> The type of the attribute being created }
  1244.         attrTag:                AttributeTag;                            { <-> The tag of the attribute being created }
  1245.         value:                    Handle;                                    { <-> The value to write (pre-allocated, resize as needed) }
  1246.     END;
  1247.  
  1248.     DETAttributeChangeBlock = RECORD
  1249.         reqFunction:            DETCallFunctions;
  1250.         callBack:                DETCallBack;
  1251.         callBackPrivate:        LONGINT;
  1252.         templatePrivate:        LONGINT;
  1253.         instancePrivate:        LONGINT;
  1254.         target:                    DETTargetSpecification;
  1255.         targetIsMainAspect:        BOOLEAN;
  1256.         filler1:                BOOLEAN;
  1257.         parent:                    PackedDSSpecPtr;                        {  -> The object within which the creation will occur }
  1258.         refNum:                    INTEGER;                                {  -> Refnum for returned address (DSSpecs in PDs only) }
  1259.         identity:                AuthIdentity;                            {  -> The identity we're browsing as in the parent object }
  1260.         attrType:                AttributeType;                            { <-> The type of the attribute being changed }
  1261.         attrTag:                AttributeTag;                            { <-> The tag of the attribute being changed }
  1262.         attrCID:                AttributeCreationID;                    { <-> The CID of the attribute being changed }
  1263.         value:                    Handle;                                    { <-> The value to write (pre-allocated, resize as needed) }
  1264.     END;
  1265.  
  1266.     DETAttributeDeleteBlock = RECORD
  1267.         reqFunction:            DETCallFunctions;
  1268.         callBack:                DETCallBack;
  1269.         callBackPrivate:        LONGINT;
  1270.         templatePrivate:        LONGINT;
  1271.         instancePrivate:        LONGINT;
  1272.         target:                    DETTargetSpecification;
  1273.         targetIsMainAspect:        BOOLEAN;
  1274.         filler1:                BOOLEAN;
  1275.         dsSpec:                    PackedDSSpecPtr;                        {  -> The object which will be deleted }
  1276.         refNum:                    INTEGER;                                {  -> Refnum for returned address (DSSpecs in PDs only) }
  1277.         identity:                AuthIdentity;                            {  -> The identity we're browsing as }
  1278.     END;
  1279.  
  1280.     DETItemNewBlock = RECORD
  1281.         reqFunction:            DETCallFunctions;
  1282.         callBack:                DETCallBack;
  1283.         callBackPrivate:        LONGINT;
  1284.         templatePrivate:        LONGINT;
  1285.         instancePrivate:        LONGINT;
  1286.         target:                    DETTargetSpecification;
  1287.         targetIsMainAspect:        BOOLEAN;
  1288.         filler1:                BOOLEAN;
  1289.     END;
  1290.  
  1291.     DETShouldSyncBlock = RECORD
  1292.         reqFunction:            DETCallFunctions;
  1293.         callBack:                DETCallBack;
  1294.         callBackPrivate:        LONGINT;
  1295.         templatePrivate:        LONGINT;
  1296.         instancePrivate:        LONGINT;
  1297.         target:                    DETTargetSpecification;
  1298.         targetIsMainAspect:        BOOLEAN;
  1299.         filler1:                BOOLEAN;
  1300.         shouldSync:                BOOLEAN;                                { <-  True if we should now sync with catalog }
  1301.         filler2:                BOOLEAN;
  1302.     END;
  1303.  
  1304.     DETDoSyncBlock = RECORD
  1305.         reqFunction:            DETCallFunctions;
  1306.         callBack:                DETCallBack;
  1307.         callBackPrivate:        LONGINT;
  1308.         templatePrivate:        LONGINT;
  1309.         instancePrivate:        LONGINT;
  1310.         target:                    DETTargetSpecification;
  1311.         targetIsMainAspect:        BOOLEAN;
  1312.         filler1:                BOOLEAN;
  1313.     END;
  1314.  
  1315.     DETPatternInBlock = RECORD
  1316.         reqFunction:            DETCallFunctions;
  1317.         callBack:                DETCallBack;
  1318.         callBackPrivate:        LONGINT;
  1319.         templatePrivate:        LONGINT;
  1320.         instancePrivate:        LONGINT;
  1321.         target:                    DETTargetSpecification;
  1322.         targetIsMainAspect:        BOOLEAN;
  1323.         filler1:                BOOLEAN;
  1324.         property:                INTEGER;
  1325.         elementType:            LONGINT;                                {  -> Element type from pattern }
  1326.         extra:                    LONGINT;                                {  -> Extra field from pattern }
  1327.         attribute:                AttributePtr;                            {  -> The complete attribute }
  1328.         dataOffset:                LONGINT;                                { <-> Offset to current (next) byte }
  1329.         bitOffset:                INTEGER;                                { <-> Bit offset (next bit is *fData >> fBitOffset++) }
  1330.     END;
  1331.  
  1332.     DETPatternOutBlock = RECORD
  1333.         reqFunction:            DETCallFunctions;
  1334.         callBack:                DETCallBack;
  1335.         callBackPrivate:        LONGINT;
  1336.         templatePrivate:        LONGINT;
  1337.         instancePrivate:        LONGINT;
  1338.         target:                    DETTargetSpecification;
  1339.         targetIsMainAspect:        BOOLEAN;
  1340.         filler1:                BOOLEAN;
  1341.         property:                INTEGER;
  1342.         elementType:            LONGINT;                                {  -> Element type from pattern }
  1343.         extra:                    LONGINT;                                {  -> Extra field from pattern }
  1344.         attribute:                AttributePtr;                            {  -> The attribute (minus the data portion) }
  1345.         data:                    Handle;                                    {  -> Data to be written (pre-allocated, resize and add at end) }
  1346.         dataOffset:                LONGINT;                                { <-> Offset to next byte to write }
  1347.         bitOffset:                INTEGER;                                { <-> Bit offset (if zero, handle will need to be resized to one more byte before write) }
  1348.     END;
  1349.  
  1350.     DETOpenSelfBlock = RECORD
  1351.         reqFunction:            DETCallFunctions;
  1352.         callBack:                DETCallBack;
  1353.         callBackPrivate:        LONGINT;
  1354.         templatePrivate:        LONGINT;
  1355.         instancePrivate:        LONGINT;
  1356.         target:                    DETTargetSpecification;
  1357.         targetIsMainAspect:        BOOLEAN;
  1358.         filler1:                BOOLEAN;
  1359.         modifiers:                INTEGER;                                {  -> Modifiers at open time (option/control/command/shift keys) }
  1360.     END;
  1361.  
  1362.     DETConvertToNumberBlock = RECORD
  1363.         reqFunction:            DETCallFunctions;
  1364.         callBack:                DETCallBack;
  1365.         callBackPrivate:        LONGINT;
  1366.         templatePrivate:        LONGINT;
  1367.         instancePrivate:        LONGINT;
  1368.         target:                    DETTargetSpecification;
  1369.         targetIsMainAspect:        BOOLEAN;
  1370.         filler1:                BOOLEAN;
  1371.         property:                INTEGER;
  1372.         theValue:                LONGINT;                                { <-  The converted value to return }
  1373.     END;
  1374.  
  1375.     DETConvertToRStringBlock = RECORD
  1376.         reqFunction:            DETCallFunctions;
  1377.         callBack:                DETCallBack;
  1378.         callBackPrivate:        LONGINT;
  1379.         templatePrivate:        LONGINT;
  1380.         instancePrivate:        LONGINT;
  1381.         target:                    DETTargetSpecification;
  1382.         targetIsMainAspect:        BOOLEAN;
  1383.         filler1:                BOOLEAN;
  1384.         property:                INTEGER;
  1385.         theValue:                RStringHandle;                            { <-  A handle with the converted value (callee must allocate handle, DE will DisposHandle() it) }
  1386.     END;
  1387.  
  1388.     DETConvertFromNumberBlock = RECORD
  1389.         reqFunction:            DETCallFunctions;
  1390.         callBack:                DETCallBack;
  1391.         callBackPrivate:        LONGINT;
  1392.         templatePrivate:        LONGINT;
  1393.         instancePrivate:        LONGINT;
  1394.         target:                    DETTargetSpecification;
  1395.         targetIsMainAspect:        BOOLEAN;
  1396.         filler1:                BOOLEAN;
  1397.         property:                INTEGER;
  1398.         theValue:                LONGINT;                                {  -> The value to convert (result should be written direct to the property) }
  1399.     END;
  1400.  
  1401.     DETConvertFromRStringBlock = RECORD
  1402.         reqFunction:            DETCallFunctions;
  1403.         callBack:                DETCallBack;
  1404.         callBackPrivate:        LONGINT;
  1405.         templatePrivate:        LONGINT;
  1406.         instancePrivate:        LONGINT;
  1407.         target:                    DETTargetSpecification;
  1408.         targetIsMainAspect:        BOOLEAN;
  1409.         filler1:                BOOLEAN;
  1410.         property:                INTEGER;
  1411.         theValue:                RStringPtr;                                {  -> The value to convert (result should be written direct to the property) }
  1412.     END;
  1413.  
  1414.     DETCustomViewDrawBlock = RECORD
  1415.         reqFunction:            DETCallFunctions;
  1416.         callBack:                DETCallBack;
  1417.         callBackPrivate:        LONGINT;
  1418.         templatePrivate:        LONGINT;
  1419.         instancePrivate:        LONGINT;
  1420.         target:                    DETTargetSpecification;
  1421.         targetIsMainAspect:        BOOLEAN;
  1422.         filler1:                BOOLEAN;
  1423.         property:                INTEGER;
  1424.     END;
  1425.  
  1426.     DETCustomViewMouseDownBlock = RECORD
  1427.         reqFunction:            DETCallFunctions;
  1428.         callBack:                DETCallBack;
  1429.         callBackPrivate:        LONGINT;
  1430.         templatePrivate:        LONGINT;
  1431.         instancePrivate:        LONGINT;
  1432.         target:                    DETTargetSpecification;
  1433.         targetIsMainAspect:        BOOLEAN;
  1434.         filler1:                BOOLEAN;
  1435.         property:                INTEGER;
  1436.         theEvent:                ^EventRecord;                            {  -> The original event record of the mouse-down }
  1437.     END;
  1438.  
  1439.     DETKeyPressBlock = RECORD
  1440.         reqFunction:            DETCallFunctions;
  1441.         callBack:                DETCallBack;
  1442.         callBackPrivate:        LONGINT;
  1443.         templatePrivate:        LONGINT;
  1444.         instancePrivate:        LONGINT;
  1445.         target:                    DETTargetSpecification;
  1446.         targetIsMainAspect:        BOOLEAN;
  1447.         filler1:                BOOLEAN;
  1448.         property:                INTEGER;
  1449.         theEvent:                ^EventRecord;                            {  -> The original event record of the key-press }
  1450.     END;
  1451.  
  1452.     DETPasteBlock = RECORD
  1453.         reqFunction:            DETCallFunctions;
  1454.         callBack:                DETCallBack;
  1455.         callBackPrivate:        LONGINT;
  1456.         templatePrivate:        LONGINT;
  1457.         instancePrivate:        LONGINT;
  1458.         target:                    DETTargetSpecification;
  1459.         targetIsMainAspect:        BOOLEAN;
  1460.         filler1:                BOOLEAN;
  1461.         property:                INTEGER;
  1462.         modifiers:                INTEGER;                                {  -> Modifiers at paste time (option/control/command/shift keys) }
  1463.     END;
  1464.  
  1465.     DETCustomMenuSelectedBlock = RECORD
  1466.         reqFunction:            DETCallFunctions;
  1467.         callBack:                DETCallBack;
  1468.         callBackPrivate:        LONGINT;
  1469.         templatePrivate:        LONGINT;
  1470.         instancePrivate:        LONGINT;
  1471.         target:                    DETTargetSpecification;
  1472.         targetIsMainAspect:        BOOLEAN;
  1473.         filler1:                BOOLEAN;
  1474.         menuTableParameter:        INTEGER;                                {  -> The "property" field from the custom menu table }
  1475.     END;
  1476.  
  1477.     DETCustomMenuEnabledBlock = RECORD
  1478.         reqFunction:            DETCallFunctions;
  1479.         callBack:                DETCallBack;
  1480.         callBackPrivate:        LONGINT;
  1481.         templatePrivate:        LONGINT;
  1482.         instancePrivate:        LONGINT;
  1483.         target:                    DETTargetSpecification;
  1484.         targetIsMainAspect:        BOOLEAN;
  1485.         filler1:                BOOLEAN;
  1486.         menuTableParameter:        INTEGER;                                {  -> The "property" field from the custom menu table }
  1487.         enable:                    BOOLEAN;                                { <-  Whether to enable the menu item }
  1488.         filler2:                BOOLEAN;
  1489.     END;
  1490.  
  1491.     DETForwarderListItemPtr = ^DETForwarderListItem;
  1492.  
  1493.     DETForwarderListItem = RECORD
  1494.         next:                    ^DETForwarderListItemPtr;                { Pointer to next item, or nil }
  1495.         attributeValueTag:        AttributeTag;                            { Tag of new templates (0 for none) }
  1496.         rstrs:                    PackedPathName;                            { Record type (empty if none), attrbute type (empty if none),
  1497.                                                 list of template names to forward to }
  1498.     END;
  1499.  
  1500.     DETForwarderListHandle = ^DETForwarderListItemPtr;
  1501.  
  1502.     DETDynamicForwardersBlock = RECORD
  1503.         reqFunction:            DETCallFunctions;
  1504.         callBack:                DETCallBack;
  1505.         callBackPrivate:        LONGINT;
  1506.         templatePrivate:        LONGINT;
  1507.         forwarders:                DETForwarderListHandle;                    { <-  List of forwaders }
  1508.     END;
  1509.  
  1510.     DETDynamicResourceBlock = RECORD
  1511.         reqFunction:            DETCallFunctions;
  1512.         callBack:                DETCallBack;
  1513.         callBackPrivate:        LONGINT;
  1514.         templatePrivate:        LONGINT;
  1515.         instancePrivate:        LONGINT;
  1516.         target:                    DETTargetSpecification;
  1517.         targetIsMainAspect:        BOOLEAN;
  1518.         filler1:                BOOLEAN;
  1519.         resourceType:            ResType;                                {  -> The resource type being requested }
  1520.         propertyNumber:            INTEGER;                                {  -> The property number of the resource being requested }
  1521.         resourceID:                INTEGER;                                {  -> The resource ID (base ID + property number) of the resource }
  1522.         theResource:            Handle;                                    { <-  The requested resource }
  1523.     END;
  1524.  
  1525.     DETCallBlock = RECORD
  1526.         CASE INTEGER OF
  1527.         0: (
  1528.             protoCall:                    DETProtoCallBlock;
  1529.            );
  1530.         1: (
  1531.             init:                        DETInitBlock;
  1532.            );
  1533.         2: (
  1534.             exit:                        DETExitBlock;
  1535.            );
  1536.         3: (
  1537.             instanceInit:                DETInstanceInitBlock;
  1538.            );
  1539.         4: (
  1540.             instanceExit:                DETInstanceExitBlock;
  1541.            );
  1542.         5: (
  1543.             instanceIdle:                DETInstanceIdleBlock;
  1544.            );
  1545.         6: (
  1546.             propertyCommand:            DETPropertyCommandBlock;
  1547.            );
  1548.         7: (
  1549.             maximumTextLength:            DETMaximumTextLengthBlock;
  1550.            );
  1551.         8: (
  1552.             viewListChanged:            DETViewListChangedBlock;
  1553.            );
  1554.         9: (
  1555.             propertyDirtied:            DETPropertyDirtiedBlock;
  1556.            );
  1557.         10: (
  1558.             validateSave:                DETValidateSaveBlock;
  1559.            );
  1560.         11: (
  1561.             dropQuery:                    DETDropQueryBlock;
  1562.            );
  1563.         12: (
  1564.             dropMeQuery:                DETDropMeQueryBlock;
  1565.            );
  1566.         13: (
  1567.             attributeCreationBlock:        DETAttributeCreationBlock;
  1568.            );
  1569.         14: (
  1570.             attributeNew:                DETAttributeNewBlock;
  1571.            );
  1572.         15: (
  1573.             attributeChange:            DETAttributeChangeBlock;
  1574.            );
  1575.         16: (
  1576.             attributeDelete:            DETAttributeDeleteBlock;
  1577.            );
  1578.         17: (
  1579.             itemNew:                    DETItemNewBlock;
  1580.            );
  1581.         18: (
  1582.             patternIn:                    DETPatternInBlock;
  1583.            );
  1584.         19: (
  1585.             patternOut:                    DETPatternOutBlock;
  1586.            );
  1587.         20: (
  1588.             shouldSync:                    DETShouldSyncBlock;
  1589.            );
  1590.         21: (
  1591.             doSync:                        DETDoSyncBlock;
  1592.            );
  1593.         22: (
  1594.             openSelf:                    DETOpenSelfBlock;
  1595.            );
  1596.         23: (
  1597.             convertToNumber:            DETConvertToNumberBlock;
  1598.            );
  1599.         24: (
  1600.             convertToRString:            DETConvertToRStringBlock;
  1601.            );
  1602.         25: (
  1603.             convertFromNumber:            DETConvertFromNumberBlock;
  1604.            );
  1605.         26: (
  1606.             convertFromRString:            DETConvertFromRStringBlock;
  1607.            );
  1608.         27: (
  1609.             customViewDraw:                DETCustomViewDrawBlock;
  1610.            );
  1611.         28: (
  1612.             customViewMouseDown:        DETCustomViewMouseDownBlock;
  1613.            );
  1614.         29: (
  1615.             keyPress:                    DETKeyPressBlock;
  1616.            );
  1617.         30: (
  1618.             paste:                        DETPasteBlock;
  1619.            );
  1620.         31: (
  1621.             customMenuSelected:            DETCustomMenuSelectedBlock;
  1622.            );
  1623.         32: (
  1624.             customMenuEnabled:            DETCustomMenuEnabledBlock;
  1625.            );
  1626.         33: (
  1627.             dynamicForwarders:            DETDynamicForwardersBlock;
  1628.            );
  1629.         34: (
  1630.             dynamicResource:            DETDynamicResourceBlock;
  1631.            );
  1632.     END;
  1633.  
  1634.     DETCallBlockPtr = ^DETCallBlock;
  1635.  
  1636. CONST
  1637.     uppDETCallBackProcInfo = $000003E0; { FUNCTION (4 byte param, 4 byte param): 2 byte result; }
  1638.  
  1639. FUNCTION CallDETCallBackProc(VAR callBlockPtr: DETCallBlock; callBackBlockPtr: DETCallBackBlockPtr; userRoutine: DETCallBackUPP): OSErr;
  1640.     {$IFC NOT GENERATINGCFM}
  1641.     INLINE $205F, $4E90;
  1642.     {$ENDC}
  1643.  
  1644. FUNCTION NewDETCallBackProc(userRoutine: DETCallBackProcPtr): DETCallBackUPP;
  1645.     {$IFC NOT GENERATINGCFM }
  1646.     INLINE $2E9F;
  1647.     {$ENDC}
  1648.  
  1649. CONST
  1650.     kDETCallForOther            = 1;                            { Call for things not listed below (also auto-enabled by DE if any of the below are enabled) }
  1651.     kDETCallForIdle                = 2;                            { kDETcmdIdle }
  1652.     kDETCallForCommands            = 4;                            { kDETcmdPropertyCommand, kDETcmdSelfOpen }
  1653.     kDETCallForViewChanges        = 8;                            { kDETcmdViewListChanged, kDETcmdPropertyDirtied, kDETcmdMaximumTextLength }
  1654.     kDETCallForDrops            = $10;                            { kDETcmdDropQuery, kDETcmdDropMeQuery }
  1655.     kDETCallForAttributes        = $20;                            { kDETcmdAttributeCreation, kDETcmdAttributeNew, kDETcmdAttributeChange, kDETcmdAttributeDelete }
  1656.     kDETCallForValidation        = $40;                            { kDETcmdValidateSave }
  1657.     kDETCallForKeyPresses        = $80;                            { kDETcmdKeyPress and kDETcmdPaste }
  1658.     kDETCallForResources        = $100;                            { kDETcmdDynamicResource }
  1659.     kDETCallForSyncing            = $200;                            { kDETcmdShouldSync, kDETcmdDoSync }
  1660.     kDETCallForEscalation        = $8000;                        { All calls escalated from the next lower level }
  1661.     kDETCallForNothing            = 0;                            { None of the above
  1662.     * All of the above }
  1663.     kDETCallForEverything        = $FFFFFFFF;
  1664.  
  1665. TYPE
  1666.     DETCallProcPtr = ProcPtr;  { FUNCTION DETCall(callBlockPtr: DETCallBlockPtr): OSErr; }
  1667.     DETCallUPP = UniversalProcPtr;
  1668.  
  1669. CONST
  1670.     uppDETCallProcInfo = $000000E0; { FUNCTION (4 byte param): 2 byte result; }
  1671.  
  1672. FUNCTION NewDETCallProc(userRoutine: DETCallProcPtr): DETCallUPP;
  1673.     {$IFC NOT GENERATINGCFM }
  1674.     INLINE $2E9F;
  1675.     {$ENDC}
  1676.  
  1677. FUNCTION CallDETCallProc(callBlockPtr: DETCallBlockPtr; userRoutine: DETCallUPP): OSErr;
  1678.     {$IFC NOT GENERATINGCFM}
  1679.     INLINE $205F, $4E90;
  1680.     {$ENDC}
  1681.     
  1682. TYPE
  1683.     DETCall = DETCallUPP;
  1684.  
  1685. { This following macro saves you from having to dig out the call-back pointer from the call block: }
  1686.  
  1687. CONST
  1688.     kSAMFirstDevProperty        = 40 + 10;
  1689.  
  1690. {
  1691.     SAM templates have additional resources/properties that are required
  1692.     for interaction with the AOCE Key Chain.
  1693.     
  1694.      Type    Offset                        Description
  1695.      ----    ------                        -----------
  1696.     'rstr'    kSAMAspectUserName            The user name
  1697.     'rstr'    kSAMAspectKind                The kind of SAM
  1698.     'detn'    kSAMAspectCannotDelete        If 0, then the slot cannot be deleted
  1699.     'sami'    kSAMAspectSlotCreationInfo    The info required to create a slot record
  1700. }
  1701.     kSAMAspectUserName            = 40 + 1;
  1702.     kSAMAspectKind                = 40 + 2;
  1703.     kSAMAspectCannotDelete        = 40 + 3;
  1704.     kSAMAspectSlotCreationInfo    = 40 + 4;
  1705.  
  1706. {*************************************************************************************
  1707.  ********************************* Admin Definitions: *********************************
  1708.  *************************************************************************************}
  1709.     kDETAdminVersion            = -978;
  1710.  
  1711.  
  1712. {$ALIGN RESET}
  1713. {$POP}
  1714.  
  1715. {$SETC UsingIncludes := OCETemplatesIncludes}
  1716.  
  1717. {$ENDC} {__OCETEMPLATES__}
  1718.  
  1719. {$IFC NOT UsingIncludes}
  1720.  END.
  1721. {$ENDC}
  1722.